package edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseController;

import edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseDao.DeviceDAO;
import edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseEntity.Device;
import edu.ynu.se.xiecheng.achitectureclass.GreenHouse.GreenhouseService.DeviceService;
import edu.ynu.se.xiecheng.achitectureclass.common.controller.LogicController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "设备信息管理")
@RestController
@RequestMapping("/device")
public class DeviceController extends LogicController<DeviceService, DeviceDAO, Device, Long> {

    public DeviceController(DeviceService service) {

        super(service);

    }

    // 可以添加其他自定义 API 接口
    @GetMapping("/get")

    @ApiOperation(value = "通过ID获取设备信息", notes = "根据设备ID获取设备信息")

    public Device GET(@RequestParam Long id) {

        return service.GET(id);

    }

}

